<?php use_helper('OpenSocial'); ?>

<script type="text/javascript">
<?php if($onLoad): ?>
  <?php echo registerOnLoadHandler($onLoad); ?>
<?php endif; ?>

function pending(content_div,msg)
{
  document.getElementById(content_div).innerHTML = '<img title="pending" src="http://sghdc.no-ip.org/opensocial/images/indicator.gif"/><small> '+msg+'</small>';
}

function adjustHeight() 
{
  if (typeof(gadgets) != 'undefined' && typeof(gadgets.window) != 'undefined' && typeof(gadgets.window.adjustHeight) != 'undefined')
    gadgets.window.adjustHeight();
  else if (typeof(_IG_AdjustIFrameHeight) != "undefined")
    _IG_AdjustIFrameHeight();
};

function postActivity(text) 
{ 
  var params = {};  
  params[opensocial.Activity.Field.TITLE] = text;
  var activity = opensocial.newActivity(params); 
  opensocial.requestCreateActivity(activity, opensocial.CreateActivityPriority.HIGH, postActivityCallback);
};        
  
function postActivityCallback(data) {
  //var title = data.getField(opensocial.Activity.Field.TITLE);
  //title = gadgets.util.unescapeString(title);
  //document.getElementById('status_div').innerHTML = title;
};

</script>

